#pragma once

class InputListener;
class RenderSystem;
class Scene;
class Client;
class Camera;

class Application
{
public:
	Application(void);
	virtual ~Application(void);
	virtual bool start(HINSTANCE hInstance);
	virtual bool loop();
	virtual bool end();
	virtual bool frame();
	virtual void draw3D();
	virtual void draw2D();
	void setClient(Client * client);
	void setInputListener(InputListener * inputListener);
	RenderSystem* getRenderSystem(){
		return mRenderSys;
	}
	Scene* getScene(){
		return mScene;
	}
	Camera* getCamera(){
		return mCamera;
	}
public:
	virtual bool wndProc(UINT message, WPARAM wParam, LPARAM lParam, LRESULT &res);
private:
	void createCamera();
protected:
	RenderSystem* mRenderSys;
	InputListener* mCurInputListener;
	Camera* mCamera;
	HWND mHwnd;
	Client * mClient;
	bool bWillEnd;
	Scene * mScene;
};

Application* getApp();